<template>
	<view>
		<view class="head">
			<text>{{ arry.name }} {{ arry.telephone }}</text>
			<view class="txt">地址：{{ add() }}</view>
			<view class="bot"></view>
		</view>
		<!-- <view class="shop">
			<image src="../../static/images/201916541220.jpg" mode=""></image>
			<view class="box">
				<view class="boxTop">1123238(苹果）</view>
				<view class="boxLeft">
					数量：2 (
					<text>¥66</text>
					)
				</view>
			</view>
		</view> -->
		<!-- 	<view class="size">
			<view class="sizeTop">
				<view class="sizeLeft">尺寸/大码（¥43.0）</view>
				<view class="sizeRight">X2</view>
			</view>
			<view class="sizeTop" style="margin-top: 34rpx;">
				<view class="sizeLeft">尺寸/小码（¥43.0）</view>
				<view class="sizeRight">X2</view>
			</view>
		</view>
		<view class="tui">
			<view class="tuiLeft">
				退款金额
			</view>
			<view class="tuiRight">
				¥66.0
			</view>
		</view> -->
		<!-- 	<view class="tui">
			<view class="tuiLeft">
			备注: 无
			</view>
			<view class="tuiRight">
		<image src="../../static/images/arrow_right.png" mode=""></image>
			</view>
		</view> -->
		<view class="but">
			<view class="butLeft" @click="go">
				应退:
				<text>¥{{ name }}</text>
				<image src="../../static/spe/01.png" mode="" @click="chan"></image>
			</view>
			<button type="primary" @click="fahuo">去发货</button>
		</view>
		<!-- 添加新规格弹窗 -->
		<uni-popup ref="popup" type="center">
			<view class="addContent">
				<view class="box">
					<view class="tit tCenter f36 c333">价格</view>
					<view class="input-box"><input type="text" placeholder="最多输入12个字符" v-model="name" /></view>
					<view class="btn f30 tCenter">
						<view class="dropBtn" @click="close">取消</view>
						<view class="submit" @click="open">确定</view>
					</view>
				</view>
			</view>
		</uni-popup>
	</view>
</template>

<script>
export default {
	data() {
		return {
			arry: {},
			addy: {},
			customer_id: '',
			name: '',
			order_type:'',
		};
	},
	onLoad() {
		this.order_type= uni.getStorageSync('odtype')
		this.arry = uni.getStorageSync('customer_id');
		this.customer_id = this.arry.customer_id;
		// console.log(this.arry);
		this.addy = uni.getStorageSync('d');

		this.addy.forEach(item => {
			this.name = +item.operate_num * +item.sell_price;
		});

		// this.addy.original_order_id=0
		// this.addy.is_delive=1
		// this.addy.order_type=1
		console.log(this.addy);
	},
	methods: {
		add() {
			return this.arry.address[0];
		},
		go() {},
		open() {
			// this.$refs.popup.open();
			this.$refs.popup.close();
		},
		close() {
			this.$refs.popup.close();
		},

		chan() {
			this.$refs.popup.open();
		},

		fahuo() {
			// this.addy.original_order_id=0
			// this.addy.is_delive=1
			// this.addy.order_type=1
			// this.addy.payable=this.name

			console.log(this.addy);
			// c.is_payment=0
			// c.product_list=this.addy
			// c.original_order_id=0
			// c.is_delive=1
			// c.customer_id=this.customer_id
			// c.payable=this.name
			// console.log(this.addy);
			this.$ajax('api/v1.order/add', {
				is_payment: 0,
				original_order_id: 0,
				is_delive: 1,
				customer_id: this.customer_id,
				payable: this.name,
				order_type:this.order_type,
				product_list: JSON.stringify(this.addy)
			})
				.then(res => {
				uni.navigateTo({
					url:'clientPage'
				})
				uni.removeStorage({
					key:'kucun'
				})
				})
				.catch(res => {
					console.log(Error);
				});
		}
	}
};
</script>

<style lang="scss">
page {
	background-color: #f7f4f8;
}
.head {
	height: 173rpx;
	box-sizing: border-box;
	background-color: #ffffff;
	margin-top: 30rpx;
	padding-top: 30rpx;
	font-size: 30rpx;
	font-family: PingFang SC;
	font-weight: 500;
	color: rgba(51, 51, 51, 1);
	position: relative;
	text {
		margin: 20px 30rpx;
	}
	.txt {
		margin: 40rpx 30rpx;
		font-size: 30rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: rgba(102, 102, 102, 1);
		margin-top: 33rpx;
	}
	.bot {
		position: absolute;
		bottom: 0;
		height: 7rpx;
		width: 100%;
		background: url(../../static/client/xian.png) no-repeat center;
		background-size: 100% 100%;
	}
}
.shop {
	height: 204rpx;
	margin-top: 20rpx;
	padding: 35rpx;
	box-sizing: border-box;
	background-color: #ffffff;
	display: flex;
	border-bottom: 2rpx solid #eeeeee;

	image {
		width: 130rpx;
		height: 130rpx;
	}
	.boxTop {
		margin-left: 40rpx;
		font-size: 30rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: rgba(51, 51, 51, 1);
	}
	.boxLeft {
		margin-left: 40rpx;
		margin-top: 52rpx;
		font-size: 30rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: rgba(102, 102, 102, 1);
		text {
			color: #f64444;
		}
	}
}
.size {
	height: 166rpx;
	padding: 33rpx;
	box-sizing: border-box;
	background-color: #ffffff;
	font-size: 30rpx;
	font-family: PingFang SC;
	font-weight: 500;
	color: rgba(102, 102, 102, 1);
	.sizeTop {
		display: flex;
		justify-content: space-between;
	}
}
.tui {
	margin-top: 20rpx;
	height: 110rpx;
	background-color: #ffffff;
	padding: 41rpx 33rpx;
	box-sizing: border-box;
	font-size: 30rpx;
	font-family: PingFang SC;
	font-weight: 500;
	color: rgba(51, 51, 51, 1);
	display: flex;
	justify-content: space-between;
	image {
		width: 18rpx;
		height: 33rpx;
	}
}
.but {
	width: 100%;
	height: 110rpx;
	position: fixed;
	bottom: 0;
	background-color: #ffffff;
	display: flex;
	box-sizing: border-box;
	font-size: 30rpx;
	font-family: PingFang SC;
	font-weight: 500;
	line-height: 110rpx;
	padding-left: 29rpx;
	.butLeft {
		width: 495rpx;
		background-color: #ffffff;
		display: flex;
		image {
			width: 44rpx;
			height: 44rpx;
			position: relative;
			top: 33rpx;
			left: 20rpx;
		}
		text {
			color: #f64444;
		}
	}
	button {
		line-height: 110rpx;
		flex: 1;
		font-size: 30rpx;
	}
}
</style>
